﻿@model ArticleClassifyEntity
@{
    ViewBag.Title = "ViewPage1";
    Layout = "../Shared/_layout.cshtml";
}
<div class="easyui-panel">
    <form method="post" action="">
    <table>
        <tr>
            <th>
                路径
            </th>
            <td>
                <div id="path">
                    @{Html.RenderAction("ClassifyPath", new { classid = Model.ParentId });}
                </div>
                @Html.HiddenFor(p => p.ParentId)
            </td>
        </tr>
        <tr>
            <th>
                名称
            </th>
            <td>
                @Html.HiddenFor(p => p.ClassId)
                @Html.TextBoxFor(p => p.ClassName)
            </td>
        </tr>
        <tr>
            <th>
                操作
            </th>
            <td>
                <input type="submit" value="保存" />
            </td>
        </tr>
    </table>
    </form>
</div>
@section JsContent{
    <script type="text/javascript">

        function updatePath(source) {
            $.get(source.href, { rnd: Math.random() }, function (result) {
                $(".pathmm").menu("hide");
                $(".pathmm").remove();
                $("#path").html(result);
                $("#path a.easyui-menubutton").menubutton();
                $(".pathmm a.pathmm_item,a.easyui-menubutton").click(function () {
                    updatePath(this);
                    return false;
                });
                $("#ParentId").val($(source).attr("menuid"));
            })
        };

        $(function () {
            $(".pathmm a.pathmm_item,a.easyui-menubutton").click(function () {
                updatePath(this);
                return false;
            });
        });
     
    </script>
}
